/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SemanticoPacote;

import compilador_full.TabelaSimbolos;

/**
 *
 * @author Laue
 */
public class cmdRepeticao {

    CmdWhile laco1 = new CmdWhile();
    CmdDoWhile laco2 = new CmdDoWhile();
    CmdFor laco3 = new CmdFor();

    public void comandoRepeticao(TabelaSimbolos tabelaSimbolos, String escopo) {

        if (tabelaSimbolos.getLookahead().equals("while")) {

            laco1.sintaxeWhile(tabelaSimbolos);

        } else if (tabelaSimbolos.getLookahead().equals("do")) {
            laco2.sintaxeCmdDoWhile(tabelaSimbolos);

        } else if (tabelaSimbolos.getLookahead().equals("for")) {
            laco3.sintaxeCmdFor(tabelaSimbolos, escopo);

        }

    }
}
